<?php /* Smarty version 2.6.18, created on 2010-03-10 23:35:42
         compiled from organism.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'cycle', 'organism.tpl', 84, false),array('modifier', 'number_format', 'organism.tpl', 93, false),)), $this); ?>
<div id="blanket" style="display:none; z-index: 800;"></div>
<div id="editOrgOrganism" style="background-color:#fff;width:500px;z-index: 900;display:none;position: absolute;"></div>
<div id="download" style="position:absolute;background-color:#fff;width:400px;z-index: 1002;display:none;"></div>

<script>	
	var dd = new ekimo_drag_region("content","editOrgOrganism");
</script>

<div id="main_content">
    	<h1>Organism Lookup</h1>
        
			<div class="blue">    
                <form method="POST" id="filterForm" >
    		    <table border=0 style="width: 100%; vertical-align: middle;">
    	            <tr>
    	                <td width="12%"><label for="filter">Group:</label></td>
    	                <td><select name="user[organismGroup]" onchange="doajaxAction('/account/orgOrganismLookup/reload/1',1,'result',document.getElementById('filterForm'))">
    	                    <option value="">Any Group</option>
    	                    <?php $_from = $this->_tpl_vars['organismGroups']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['group']):
?>
    	                        <option value="<?php echo $this->_tpl_vars['group']['organism_group_id']; ?>
"><?php echo $this->_tpl_vars['group']['organism_group']; ?>
</option>
    	                    <?php endforeach; endif; unset($_from); ?>
    	                </select></td>
    	            </tr>
    				<tr>
						<td><label for="filter">Ordering status:</label></td>
                		<td width="100%"><select style="width: 150px; " name="user[filter]" onchange="doajaxAction('/account/orgOrganismLookup/reload/1',1,'result',document.getElementById('filterForm'))">
                    				<option value='All'>No Filter</option>
									<option value='Active'>Allow Order</option>
									<option value='Inactive'>Disallow Order</option>
						</select></td>
					</tr>
					<tr>
    					<td><label for="filter">Name Filter:</label></td>
    					<td>
    						<select style="width: 150px; " name="user[alpha]" onchange="doajaxAction('/account/orgOrganismLookup/reload/1',1,'result',document.getElementById('filterForm'))" >
    							<option value="">No Filter</option>
    							<option value="#" selected>#</option>
    							<option value="a">A</option><option value="b">B</option><option value="c">C</option><option value="d">D</option><option value="e">E</option><option value="f">F</option><option value="g">G</option><option value="h">H</option><option value="i">I</option><option value="j">J</option><option value="k">K</option><option value="l">L</option><option value="m">M</option><option value="n">N</option><option value="o">O</option><option value="p">P</option><option value="q">Q</option><option value="r">R</option><option value="s">S</option><option value="t">T</option><option value="u">U</option><option value="v">V</option><option value="w">W</option><option value="x">X</option><option value="y">Y</option><option value="z">Z</option>
    						</select>	
							OR <label for="filter">Search Name:</label>	
							<input name="user[searchName]" type="text" onkeypress="search(event);" />		
    					</td>
    				</tr>
    				<tr>
    	                <td nowrap>&nbsp;</td>
    	                <td style="white-space:nowrap;">&nbsp;</td>
        			</tr>					
    				<tr>
    	                <td nowrap>&nbsp;</td>
    	                <td style="white-space:nowrap;">&nbsp;<input type="button" value="Search" onclick="doajaxAction('/account/orgOrganismLookup/reload/1',1,'result',document.getElementById('filterForm'));" id="searchid">
							<input type="button" value="Save to Excel" onclick="saveToExcel();">
						</td>
        			</tr>
					<!-- <tr>
						<td colspan="2" style="text-align: right">
							<input type="button" value="Check for New Organism" onclick="openWindow('/account/editOrgOrganism/orgOrganism/0','Organisms',500,500,'scrollbars=yes');" />				
						</td>
		            </tr> -->
    		    </table>
    		    </form>
        	</div><!-- blue -->
            
        	<div id="result">
				 <div>
					<table border="0" width="100%">
						<tr><td colspan="10"><hr></td></tr>
						<tr>
							<?php if ($this->_tpl_vars['orgOrganisms'][0]['name'] <> ''): ?>
								<td align="center" style="padding-left: 5pt, padding-right: 5pt">&nbsp;&nbsp;Edit&nbsp;&nbsp;</td>
							<?php endif; ?>
							<td align="center">Image</td>
							<td>Name</td>
							<td align="right">Ordering Status</td>
							<td align="right">Last Buy</td>
							<td align="right">Last Sale</td>
							<td align="right">Base Price</td>
							<td align="right">Reorder</td>
							<td>Default Supplier</td>
							<td align="right">Min Order</td>
						</tr>
						<tr><td colspan="10"><hr></td></tr>
						<tr>
						<?php $_from = $this->_tpl_vars['orgOrganisms']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['organism']):
?>
							<tr class="<?php echo smarty_function_cycle(array('values' => 'blue,notify'), $this);?>
">
							<?php if ($this->_tpl_vars['organism']['name'] <> ''): ?>
								<td align="center"><a href="javascript:void(0);" onclick="editOrgOrganism('<?php echo $this->_tpl_vars['organism']['org_organism_id']; ?>
');">Edit</a></td>
							<?php endif; ?>
							<td width="10%" align="center">   
								<img  onclick="PopEx(this, null, null, null, 300, 50, 'PopBoxImageLarge');" pbCaption="<i><?php echo $this->_tpl_vars['organism']['scientific_name']; ?>
</i>, <?php echo $this->_tpl_vars['organism']['name']; ?>
" id="trade<?php echo $this->_tpl_vars['key']; ?>
" width="98" src="/app/default/www/images/thumbs/<?php echo $this->_tpl_vars['organism']['image']; ?>
.jpg" pbsrc="/app/default/www/images/thumbs/<?php echo $this->_tpl_vars['organism']['image']; ?>
.jpg" class="PopBoxImageSmall" title="Click to magnify/shrink">
							</td>
							<td><i>as<?php echo $this->_tpl_vars['organism']['scientific_name']; ?>
</i><br><?php echo $this->_tpl_vars['organism']['name']; ?>
<br>Size : <?php echo $this->_tpl_vars['organism']['size_name']; ?>
</td>
							<td align="right"><?php echo $this->_tpl_vars['organism']['ordering_status']; ?>
</td>
							<td align="right"><?php echo ((is_array($_tmp=$this->_tpl_vars['organism']['last_buy'])) ? $this->_run_mod_handler('number_format', true, $_tmp, "2%d") : number_format($_tmp, "2%d")); ?>
</td>
							<td align="right"><?php echo ((is_array($_tmp=$this->_tpl_vars['organism']['last_sale'])) ? $this->_run_mod_handler('number_format', true, $_tmp, "2%d") : number_format($_tmp, "2%d")); ?>
</td>
							<td align="right"><?php echo $this->_tpl_vars['organism']['currency_mark']; ?>
&nbsp;&nbsp;<?php echo ((is_array($_tmp=$this->_tpl_vars['organism']['base_price_sale'])) ? $this->_run_mod_handler('number_format', true, $_tmp, "2%d") : number_format($_tmp, "2%d")); ?>
</td>
							<td align="right"><?php echo ((is_array($_tmp=$this->_tpl_vars['organism']['reorder_level'])) ? $this->_run_mod_handler('number_format', true, $_tmp, "0%d") : number_format($_tmp, "0%d")); ?>
</td>
							<td><?php echo $this->_tpl_vars['organism']['supplier_name']; ?>
</td>
							<td align="right"><?php echo ((is_array($_tmp=$this->_tpl_vars['organism']['min_order'])) ? $this->_run_mod_handler('number_format', true, $_tmp, "0%d") : number_format($_tmp, "0%d")); ?>
</td>
							</tr>
						<?php endforeach; endif; unset($_from); ?>
						<tr><td height="20"></td></tr>
						</tr>
					</table>
				 </div>
            </div><!-- results -->
            
</div>
<script language="javascript">
<?php echo '

	function search(e){
		 if (window.event) { e = window.event; }
         if (e.keyCode == 13){
			document.getElementById(\'searchid\').click();
		}
	}

	function editOrgOrganism(orgOrgId){
		doajaxAction("/account/editOrgOrganism/orgOrgId/"+orgOrgId,0,\'editOrgOrganism\');
		popup("editOrgOrganism");
	}

	function saveToExcel(){
		doajaxAction("/account/saveOrganismLookup",0,\'download\');
		popup("download");
	}

'; ?>

</script>